import { axios } from '@/utils/request'

const api = {
  list: '/plugins/wxlive/live/index',
  edit: '/plugins/wxlive/live/edit',
  goodsList: '/plugins/wxlive/goods/index',
  delGoods: '/plugins/wxlive/goods/delete',
  addRoomGoods: '/plugins/wxlive/live/goods-add',
  playback: '/plugins/wxlive/live/huifang',
  addGood: '/plugins/wxlive/goods/goods-add',
  delRoom: '/plugins/wxlive/live/delete',
  getGoods: '/plugins/wxlive/live/get-goods'
}

export default api

export function getWxliveList (parameter) {
  return axios({
    url: api.list,
    method: 'get',
    params: parameter
  })
}

export function saveWxlive (parameter) {
  return axios({
    url: api.edit,
    method: 'post',
    data: parameter
  })
}

export function getWxliveGoods (parameter) {
  return axios({
    url: api.goodsList,
    method: 'get',
    params: parameter
  })
}

export function deleteWxliveGood (parameter) {
  return axios({
    url: api.delGoods,
    method: 'post',
    data: parameter
  })
}

export function addRoomGoods (parameter) {
  return axios({
    url: api.addRoomGoods,
    method: 'post',
    data: parameter
  })
}

export function playback (parameter) {
  return axios({
    url: api.playback,
    method: 'get',
    params: parameter
  })
}

export function addGood (parameter) {
  return axios({
    url: api.addGood,
    method: 'post',
    data: parameter
  })
}

export function deleteRoom (parameter) {
  return axios({
    url: api.delRoom,
    method: 'post',
    data: parameter
  })
}

export function getGoodsList (parameter) {
  return axios({
    url: api.getGoods,
    method: 'get',
    params: parameter
  })
}
